#include <my_head.h>


void sig_func(int signum){
    if(SIGPIPE==signum)
        printf("nihao\n");
}

int main(int argc, const char *argv[]){
    signal(SIGPIPE,sig_func);

    int pipefd[2];
    if(-1==pipe(pipefd))
        ERR_LOG("pipe error");
    close(pipefd[0]);
    write(pipefd[1],"hhhhh",5);
    close(pipefd[1]);
    return 0;
}